package com.czh.auth.infra.basic.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.czh.auth.infra.basic.mapper.AuthRolePermissionMapper;
import com.czh.auth.infra.basic.entity.AuthRolePermission;
import com.czh.auth.infra.basic.service.AuthRolePermissionService;
import org.springframework.stereotype.Service;

import java.util.List;
import lombok.RequiredArgsConstructor;

/**
 * 角色权限关联表(AuthRolePermission)表服务实现类
 *
 * @author caozaihui
 * @since 2024-08-30 21:36:01
 */
@Service("authRolePermissionService")
@RequiredArgsConstructor
public class AuthRolePermissionServiceImpl extends ServiceImpl<AuthRolePermissionMapper, AuthRolePermission> implements AuthRolePermissionService {
       
 
        /** 
         * 
         * @param  id 主键
         * @author caozaihui  
         * @description //TODO  通过ID查询单条数据
         * @date 2024-08-30 21:36:01
         * @return 实例对象
         */
        @Override
        public AuthRolePermission selectAuthRolePermissionById (Long id) {
                return baseMapper.selectById(id);
        }
        
        /** 
         * 
         * @param authRolePermission 实例对象
         * @author caozaihui  
         * @description //TODO  分页查询数据
         * @date 2024-08-30 21:36:01
         * @return 实例对象
         */
        @Override
        public List<AuthRolePermission> queryAuthRolePermissionList (AuthRolePermission authRolePermission) {
            return baseMapper.selectAuthRolePermissionList(authRolePermission);     
        }
        
        /** 
         * 
         * @param authRolePermission 实例对象
         * @author caozaihui  
         * @description //TODO  新增数据
         * @date 2024-08-30 21:36:01
         * @return 实例对象
         */
        @Override
        public int insert(AuthRolePermission authRolePermission) {
               return baseMapper.insert(authRolePermission);
        }

        @Override
        public int insertBatch(List<AuthRolePermission> authRolePermissions) {
                return baseMapper.insertBatchAuthRolePermissionList(authRolePermissions);
        }


        /** 
         * 
         * @param authRolePermission 实例对象
         * @author caozaihui  
         * @description //TODO  修改数据并返回
         * @date 2024-08-30 21:36:01
         * @return 实例对象
         */
        @Override
        public int update(AuthRolePermission authRolePermission) {
                return  baseMapper.updateById(authRolePermission);
        }
        
        
        /**
         *
         * @param idList 主键
         * @author caozaihui 
         * @description //TODO    通过主键删除数据
         * @date 2024-08-30 21:36:01
         * @return
         */
        @Override
        public int deleteByIds(List<Long> idList) {
            return baseMapper.deleteByIds(idList);
        }
}

